{% extends 'Base.html' %}
{% load staticfiles %}
{% load carousel %}
{% load side %}
{% block main %}
    <div class="layui-col-md8">
        {% include 'index/notice.html' %}
        <div class="layui-row">
            <div class="layui-col-md12">
                {# 轮播 #}
                {% images %}
            </div>

            <div class="layui-col-md12" style="margin-top: 5px">
                {# 置顶 #}
                <div>
                    {% for article in articles %}
                        <div class="article-list-warp">
                            <a href="{% url 'article-detail-view' article.id %}" target="_blank">
                                <h3 class="layui-hide-xs">
                                    {% if article.top %}
                                        <span class="layui-badge-rim" style="color: #FF5722">推荐</span>
                                    {% endif %}
                                    <span style="font-size: 18px;font-weight: bold"> {{ article.title }}</span>
                                </h3>
                                <h3 class="layui-hide-sm layui-hide-md layui-hide-lg">
                                    {% if article.top %}
                                        <span class="layui-badge-rim" style="color: #FF5722">推荐</span>
                                    {% endif %}
                                    <span style="font-size: 16px;">{{ article.title }}</span>
                                </h3>
                            </a>
                            <small style="color:#888;word-wrap:break-word">{{ article.summary|slice:'100' }}</small>
                            <br/>
                            <span class="layui-badge layui-bg-blue">{{ article.category_name }}</span>
                            <span style="color: #009688"><small>更新时间：{{ article.update_time }}，作者：{{ article.nick_name }}</small></span>
                        </div>
                    {% endfor %}
                </div>
                {# 查看更多 #}


                <a href="{% url 'article-category' 'all' %}">
                    <button class="layui-btn layui-btn-fluid">查看更多</button>
                </a>
            </div>
        </div>
    </div>
    <link rel="stylesheet" href="{% static 'css/articlelist.css' %}">
{% endblock %}
{% block side %}
    <div class="layui-col-md4">
        {% include 'side/search.html' %}
        {# 分类 #}
        {% categorys %}
        {# 推荐阅读 #}
        {% recommends %}
        {% include 'side/about.html' %}
        {# 友情链接 #}
        {% include 'import/friend_links.html' %}
        <div style="text-align: center;background-color: white">
            <a href="/sitemap.xml">网站地图</a>
        </div>
    </div>
{% endblock %}
